const html = `<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Title</title>
  </head>
  <body>
    <button id="btn">LocalStorage发信息给页面2</button>
    <div class="content"></div>
    
    <script>
      const btn = document.getElementById('btn')
      const content = document.getElementsByClassName('content')

      window.onstorage = function (e) {
        if (e.key == 'message') {
          content[0].innerHTML = e.newValue
        }
      }
      btn.onclick = () => {
        localStorage.setItem('message', 'LocalStorage发信息给页面2')
      }
    </script>
  </body>
</html>
`;

export default html;
